package com.dsr.controller;

import com.dsr.bean.HomeBean;
import com.dsr.consts.Result;
import com.dsr.service.HomepageService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * (Homepage)表控制层
 *
 * @author dsr
 * @since 2020-08-13
 */
@RestController
@RequestMapping("/homepage")
@Api( tags = "(Homepage)表控制层")
public class HomepageController {

    @Autowired
    private HomepageService homepageService;

    @ApiOperation("更具id获取实体")
    @GetMapping("/get")
    public Result getEntity() {
        return homepageService.getEntity();
    }

    @ApiOperation("保存操作")
    @ApiParam(name = "homeBean", value = "实体", required = true)
    @PostMapping("/save")
    public Result save(@RequestBody HomeBean homeBean) {
        return homepageService.save(homeBean);
    }

    @ApiOperation("更新操作")
    @ApiParam(name = "homeBean", value = "实体", required = true)
    @PutMapping("/update")
    public Result update(@RequestBody HomeBean homeBean) {
        return homepageService.update(homeBean);
    }


}